<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/easyui/public-method.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-orange/easyui.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-red/window.css">

</head>
<body>

<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});
$(function(){
	
	$(".gsj_wan").click(function(){
		var zongfeng = 0 ;//总分
		var s1 = 0;//选择题总分
	   $(".xuanzetiddd").each(function(){
			var xz=$(this).find(".xzfs").text();
			var zx=$(this).find(".zxda1").text();
			var xq=$(this).find(".zqda1").text();
			if(zx==xq){
				s1+=parseInt(xz);
			}
	 	});
		
		var s2 = 0;//综合题总分
		$(".ergthbvcdscvb").each(function(){
			var xztfs = $(this).find("span").text();
			var xztfss = $(this).find(".gsj_zhpinfen").find("input").val();
			if(parseInt(xztfss)>parseInt(xztfs)){
				s2+= parseInt(xztfs);
			}else{
				s2+= parseInt(xztfss);
			}
		});
		
		zongfeng=parseInt(zongfeng)+s1;
		zongfeng=parseInt(zongfeng)+s2;

		 var sjzf = $(".zfzf").val();
		 var s1 = parseInt(zongfeng);
		 var s2 = parseInt(sjzf);
		 var s3 = s1/s2;
		 var ss = s3*100;
			 $("#gsj_zongfentankuang").window("open"); 
				$(".gsj_zongfen").text(ss);
				
				
				 
	 });
	
	$(".gsjqueding").click(function(){
		//提交总分
		 var daid=$(".daid").val();
		 var ionid=$(".ionid").val();
		 var zongfen=$(".gsj_zongfen").text();
		 $.ajax({
				url:"zongfentijiao",
				type:"post",
				data:{"DAID":daid,"IONID":ionid,"TRTSFENS":ss},
				success:function(data){
					$("#gsj_zongfentankuang").window("close"); 
					close("改试卷");
				}
			})
	})
	//判断输入分数是否大于题目总分
	$(".zhtfaaasss").change(function(){
		$(".ergthbvcdscvb").each(function(){
			var xztfs = $(this).find("span").text();
			var xztfss = $(this).find(".gsj_zhpinfen").find("input").val();
			if(parseInt(xztfss)>parseInt(xztfs)){
				
			}else{
				
			}
		});
	});
	
});

$(document).ready(function(){
	
});

</script>
                   <div id="gsj_zongfentankuang" class="easyui-window" title="总分" style="width:320px;height:205px"
		    		    data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,modal:true">
		    		             <div class="gsj_zongfentankuangone">
		    		             	       <div class="gsj_zongfen1">该试卷正确比例为(%)：<span class="gsj_zongfen"></span></div>
		    		             </div> 
		    		             <div class="gsj_zongfentankuangtwo">
		    		                  <button id="dsx-beok" class="gsjqueding">确定</button>
		    		             </div>
		    		</div>
		   <div class="gaishijuan_zong">
		                  <div class="gsj_huanying">欢迎参加AWSLNB公司考试</div>
		    		      <div class="gsj_top">
		    		              <div class="gsj_shijuan">${gsjs[0]["OUTNAME"] }考试试卷</div>
		    		              <div class="gsj_zhunkaozheng">准考证号：${gsjs[0]["ZKZREM"] }</div>
		    		              <input type="hidden" class="zfzf" value="${gsjs[0]['OUTZONF'] }">
		    		      </div>
		    		     
		    		      <div class="gsj_bottom">
		    		             <div class="gsj_xunzheti">
		    		             		<div class="gsj_xunzhe">选择题   </div>
		    		             		
			    		                 <div class="gsjxz_timu">
			    		                 	<%! int s=0; %>
		    		             			<c:forEach items="${gsjs.get(1)}" var="s">
		    		             			<c:if test="${s['TMTYPE']=='选择题' }">
			    		                      	<div class="gsjxz_timu2 xuanzetiddd">(<span class="xzfs">${s["TMFS"] }</span>分)<%= s=s+1 %> . ${s["TM"] }<span style="border-bottom:1px solid black;${s['SXDA']!=s['TMBDA']?'color:red;':'' }" class="zxda1">${s["SXDA"] }</span>(正确答案：<span class="zqda1">${s["TMBDA"] }</span>)</div>
												<div class="gsjxz_daan">
			    		                         <div class="gsjxz_daan1"><input type="hidden" value="A" name="zhi<%= s %>"/>A.${s["DA1"] }</div>
			    		                         <div class="gsjxz_daan2"><input type="hidden" value="B" name="zhi<%= s %>"/>B.${s["DA2"] }</div>
			    		                         <div class="gsjxz_daan3"><input type="hidden" value="C" name="zhi<%= s %>"/>C.${s["DA3"] }</div>
			    		                         <div class="gsjxz_daan4"><input type="hidden" value="D" name="zhi<%= s %>"/>D.${s["DA4"] }</div>
			    		                          <div class="gsjxz_daan4 none"><input type="radio" value="0" name="zhi<%= s %>" checked="checked"/></div>
			    		                      </div>
			    		                    </c:if>
		    		             			</c:forEach>
			    		                 </div> 
		    		                 
		    		             </div>
		    		              <div class="gsj_zongheti">
		    		                 <div class="gsj_zonghe">综合题</div>
		    		                 <div class="gsjzh_timu">
		    		                 <c:forEach items="${gsjs[1]}" var="ss">
		    		             			<c:if test="${ss['TMTYPE']=='综合题'}">
		    		                 	<div class="ergthbvcdscvb">
			    		                      <div class="gsjzh_timu2">(<span class="zhfs">${ss["TMFS"] }</span>分)<%= s=s+1 %> . ${ss['TM'] }</div>
		    		                          <div class="gsjzh_daan zonghetiefvc"><textarea cols="50" rows="10" class="sjzh_da" id="sj_daan" class="zqda2" readonly="readonly">${ss["SXDA"] }</textarea></div>
		    		                             <div class="gsj_zhpinfen">
		    		             	                <div class="gsj_zhpinfen1">评分：</div>
													<script type="text/javascript" src="../static/zx/js/increment.js"></script>
		    		             	                <div class="gsj_zhpinfen2"><div class="gsj_zhtpinfen none">评分不可超过题目总分！</div><input type="text" class="gsj_pinfen3" value="0" onkeyup="value=value.replace(/[^\d]/g,'')">分</div>
		    		             	             </div>
		    		                    </div>
		    		                    </c:if>
		    		             	</c:forEach>
		    		             	        
		    		             	  </div>
		    		                </div>
		    		              </div>
								
		    		      
		    		       <input type="hidden" value="${gsjs[0]['DAID'] }" class="daid">
		    		       <input type="hidden" value="${gsjs[0]['IONID'] }" class="ionid">
		    		       
		    		      <div class="gsj_wancheng"><button class="gsj_wan">批改完成</button></div>
		  </div>
</body>

</html>